Florian Müllner [Sat, 17 Jun 2017 16:14:20 +0000 (18:14 +0200)]
dateMenu: Set _delegate on non-menu-item menu child
PopupMenu needs special-treatment of certain types of menu items,
which it determines via children's _delegate property. However as
the calendar drop-down is very unmenu-ish, we use regular actors
rather than PopupMenuItems and the missing _delegate property
triggers a warning. Just add it as the bare minimum to make
PopupMenu happy.
Florian Müllner [Tue, 13 Jun 2017 03:51:31 +0000 (05:51 +0200)]
windowManager: Fix a warning
The destroy effect currently relies on a monkey-patched property
added from the map effect. However on X11 it is possible that we
did no map animation for a window that is destroyed when the shell
was restarted or had taken over from another WM. Just use the real
MetaWindow property to avoid a warning in that case.
layout: Skip strut computation in the no-monitor case
It's possible for updateRegions() to be called before monitors have
been properly initialized. Instead of throwing an error in that case,
just skip the strut computation (that doesn't make sense anyway without
a monitor).
Florian Müllner [Tue, 13 Jun 2017 03:39:06 +0000 (05:39 +0200)]
layout: Range-check index before array lookup
findMonitorForActor() may be called before the layoutManager gets
to initialize monitors, so make sure the monitor index is in range
to avoid a warning.
Florian Müllner [Tue, 13 Jun 2017 03:03:17 +0000 (05:03 +0200)]
ibusManager: Fix a warning
Don't try to access a non-existent engine - it probably makes sense to
use Map() instead of a plain object to track engines in the future, but
for now just add an additional check to shut up a warning.
Florian Müllner [Tue, 13 Jun 2017 02:56:34 +0000 (04:56 +0200)]
history: Fix bogus return value
We only use lastItem() to reset the history index to the end, so
nobody noticed the utter nonsense in the return value until gjs
started to warn about it. As we don't actually use the value
anywhere, we could just remove it, but the function name implies
that an item is returned, so fix it to behave as advertised.
Florian Müllner [Tue, 13 Jun 2017 02:46:37 +0000 (04:46 +0200)]
panel: Fix a JS warning
We need to track the open-status of indicator menus, but don't want
to hook up signals more than once, so we check for the handler ID
we store on the object. As the property is only defined once we did
set up the signal connection, this check now logs a warning. We
can avoid it by checking for the existence of the property rather
than a particular value.
Florian Müllner [Tue, 13 Jun 2017 02:17:39 +0000 (04:17 +0200)]
remoteMenu: Add actionGroup accessor
To avoid recreating the app menu unnecessarily, the panel checks
whether the menu's current actionGroup already matches the target
one. However as the menu's actionGroup property is currently private,
the test always fails, whoops.
Florian Müllner [Tue, 13 Jun 2017 01:41:42 +0000 (03:41 +0200)]
dash: Fix some JS warnings
We currently use "array[index]" to test whether an array has an
element at index before using it. However nowadays gjs warns about
accessing non-existent array elements, so the test itself already
produces a warning. Avoid this by checking the array length before
using an index to access an element.
Florian Müllner [Tue, 13 Jun 2017 02:24:12 +0000 (04:24 +0200)]
Initialize properties in _init()
While we've always considered it good style to initialize JS properties,
some code that relies on uninitialized properties having an implicit
value of 'undefined' has slipped in over time. The updated SpiderMonkey
version used by gjs now warns when accessing those properties, so we
should make sure that they are properly initialized to avoid log spam,
even though all warnings addressed here occur in conditionals that
produce the correct result with 'undefined'.
Florian Müllner [Fri, 9 Jun 2017 15:34:43 +0000 (17:34 +0200)]
loginDialog: Only highlight a single item at any time
The user list uses the same indication for hover and focus, so it
is possible for two items to be highlighted at the same time. Using
different styling would improve the situation, but only to some
extent - the user would still need to figure out which highlight
corresponds to which activation method. So instead, copy the
approach we use in popup menus and use a single property for
highlights that is updated by both focus- and hover changes.
Florian Müllner [Fri, 9 Jun 2017 14:06:39 +0000 (16:06 +0200)]
volume: Show OSD popup when changing volume via scroll
It is possible to use the scroll wheel to adjust the volume without
opening the system menu, but there is no feedback other than the
icon itself in that case. To provide a less coarse indication for
the volume level, display the OSD window when adjusting the volume
while the slider isn't visible.
Florian Müllner [Fri, 16 Jun 2017 15:08:07 +0000 (17:08 +0200)]
system: Emulate click action button release
Since commit 2c070d38, we add a ClickAction to the visible AltSwitcher
button to track long-presses. As a result, we now have two components
that will grab and ungrab the pointer for the button, so to make sure
we don't end up with a stuck grab, we need to release the second's
component grab when the first activates.
Currently we only drop the StButton grab on long-press, we also need
to cancel any initiated long-press on click.
Ray Strode [Wed, 7 Jun 2017 19:00:11 +0000 (15:00 -0400)]
gdmUtil: Fix auth prompt drawing over user list
If the user fails to enter their password then hits escape, we
jump back to the user list, then ask again for a password in a
garbled screen. this commit fixes that by skipping a retry if
the operation is cancelled.
Florian Müllner [Thu, 29 Jun 2017 22:06:53 +0000 (00:06 +0200)]
st: Don't try to create shadow for empty texture
Even though the API documentation doesn't say so, the underlying
Cogl texture of a ClutterTexture may be unset, so check for that
case to avoid a runtime warning.
Florian Müllner [Tue, 20 Jun 2017 08:16:05 +0000 (10:16 +0200)]
panel: Consider visibility changes for solid style
We currently assume that window state changes are accompanied by an
allocation change (triggered for example by the minimize animation).
However this misses the case where a window actor is simply hidden
without any transition, as is the case with the 'show-desktop' action
for instance, so start tracking plain visibility changes as well.
Florian Müllner [Fri, 23 Jun 2017 15:37:13 +0000 (17:37 +0200)]
util: Force text direction of time strings
While the string returned by formatTime() should follow the locale's
text direction as a whole, the actual time part is always expected
to put hours on the left and minutes to the right. It is possible to
enforce that by inserting a left-to-right mark, but so far this is
only done by the Hebrew translation. So in order to not require all
other RTL translations to be fixed individually, just insert the
mark into the returned string ourselves like gnome-desktop's WallClock
code does[0].
workspace: Reset source IDs to zero after removing them
There were some source IDs that were not being reset to zero when
removing the associated sources, resulting on some critical errors
being dumped when _realRecalculateWindowPositions() got called
after that point, via _delayedWindowRepositioning().
Ray Strode [Wed, 7 Jun 2017 19:00:11 +0000 (15:00 -0400)]
gdmUtil: Fix auth prompt drawing over user list
If the user fails to enter their password then hits escape, we
jump back to the user list, then ask again for a password in a
garbled screen. this commit fixes that by guarding against the retry
if the fail counter is reset.
calendar-server: Specify the timezone for the view query
Otherwise UTC is used which results in a different interpretation of
floating time events. This then could lead to a mismatch with events
generated e_cal_client_generate_instances_sync() which always uses the
default timezone. Such a mismatch would then cause constant invalidation
and reloading.
appDisplay: Add a null-check for the scrollview's fade ClutterEffect
This effect will only be created when the StScrollView actor has either
a non-zero vertical or horizontal fade offset defined, so we need to
add a null-check in these two cases before assuming it's there.
Cosimo Cecchi [Tue, 27 Aug 2013 20:47:19 +0000 (13:47 -0700)]
Remove an explicit destroy to the ClutterText actor
This is the same as the previous commit, but for StEntry.
We don't have any need to explicitly destroy this actor in our dispose
implementation, and doing so breaks the assumption that we can access
the clutter_text from within destroy.
Cosimo Cecchi [Wed, 5 Jun 2013 20:54:09 +0000 (13:54 -0700)]
Remove dangerous explicit destroy
There's no need to explicitly destroy the ClutterText actor inside the
label; doing so is actually harmful, as it will break the normal
reference cycle between container and children.
As StLabel doesn't hold any extra reference to the ClutterText actor and
just uses clutter_actor_add_actor() to add it to itself, let the normal
container dispose cycle run to dispose of the reference.
Bastien Nocera [Wed, 31 May 2017 14:03:16 +0000 (16:03 +0200)]
portalHelper: Fix auth URI not being passed to window
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/portalHelper/main.js 360]: reference to undefined property top.uri
is caused by the URI variable actually being called "url".
Bastien Nocera [Thu, 18 May 2017 16:13:12 +0000 (18:13 +0200)]
portalHelper: Don't go through proxies for captive portals
When using an SSH tunnel (through a SOCKS proxy) to funnel all
the outgoing traffic, we need the captive portal to not go through that
proxy, otherwise we can't go through the proxy because we're not
connected to the Internet and we can't go through the portal because
we're not connected through the proxy.
This fixes a blank captive portal window and no error reporting in that
particular configuration.
Florian Müllner [Sat, 27 May 2017 03:03:11 +0000 (05:03 +0200)]
tests: Adjust test runner
The script currently assumes that srcdir is relative to builddir,
which is not the case for build directories outside the source tree
like the one used by jhbuild.
While we could get fancy and prepend the builddir if srcdir is relative,
there's nothing wrong with a relative path as we cd into the builddir
before evaluating srcdir.
Florian Müllner [Sun, 28 May 2017 13:06:45 +0000 (15:06 +0200)]
build: Stop building a separate libgnome-shell-base
The static library was split out to avoid duplicate compilation
of mutter-independent libgnome-shell sources when we had a
wayland/non-wayland split. With the separate libmutter-wayland
library long gone, there's no reason to make the build more
complicated than it needs to be, so fold libgnome-shell-base
back into the regular libgnome-shell.
GTK+ switched from ruby-based sass to c-based sassc for performance
reasons. It makes sense to follow suit, if not to not require two
tools for the same job ...
Florian Müllner [Mon, 29 May 2017 15:20:36 +0000 (17:20 +0200)]
panel: Update .solid style on session mode changes
The .solid style isn't supposed to apply for modes that don't support
windows, but for this to work we have to update the style on session
mode changes.
Florian Müllner [Tue, 23 May 2017 09:04:28 +0000 (11:04 +0200)]
lookingGlass: Use standard icon names for GC icon
Commit b929320d4 added a toolbar item to force garbage collection,
however it won't be visible for most users, as it uses a non-standard
legacy icon name (the default icon theme dropped it as far back as 2009).
Alessandro Bono [Sat, 20 May 2017 15:56:48 +0000 (17:56 +0200)]
windowManager: Add animations for maximize and unmaximize
The fullscreen animation code is now generic enough to handle any
size change animations, so stop limiting it to (un)fullscreen to
get animations on (un)maximize as well.
Alessandro Bono [Sat, 20 May 2017 14:34:35 +0000 (16:34 +0200)]
windowManager: Generalize translation values
Currently, the translation values are set with the assumption that
one of the actors represents a fullscreen window. In order to
generalize it for any size change transition, we can simply swap
the monitor rect with the source or target rect as appropriate,
and translate the actor from the target to the source position by
subtracting the former and adding the latter.
Alessandro Bono [Sat, 20 May 2017 15:06:28 +0000 (17:06 +0200)]
windowManager: Rename variable
Since there is already targetRect that represents where the
window is going to move, rename oldRect to sourceRect to
represent from where the window is moving.
Carlos Garnacho [Tue, 28 Feb 2017 12:35:57 +0000 (13:35 +0100)]
switcherPopup: Ignore implicit enter events when the popup is mapped
If the popup happens to be mapped beneath the pointer, mutter will now
emit an implicit enter notify event (i.e. not caused by pointer motion).
In this case the switcherPopup still goes and selects the item, which
results in too sensitive alt-tab menus if the pointer happens to be in
the wrong place.
Make highlighting rely on motion events instead, so it always involves
user interaction when triggered by the pointer.
Florian Müllner [Sun, 21 May 2017 19:12:49 +0000 (21:12 +0200)]
util: Always use 12h format if requested
Whether we show times in 12h format currently depends on:
- the 'clock-format' desktop setting
- the locale support for AM/PM
This was consist with other GNOME components, however both the
WallClock[0] and the Date+Time Settings panel[1] dropped the
second check after GDateTime started supporting AM/PM independently
from the locale, so we should follow suite.
Michael Biebl [Mon, 15 May 2017 05:12:12 +0000 (07:12 +0200)]
Switch to stable libsecret API
Most of the libsecret API was declared stable in 0.18 and the stable API
now provides everything we need, so switch from libsecret-unstable to
libsecret-1.
The solid black top bar we currently use works well for maximized
or tiled windows, as it puts focus on the application content by
blending into the monitor bezel. However it also visually reduces
the screen space, which is particularly noticeable when no window
is located nearby. Having the top bar blend with the background is
a better option in that case, so track window positions and add
some transparency when the top bar is free-floating.
Carlos Garnacho [Mon, 16 Jan 2017 15:36:21 +0000 (16:36 +0100)]
keyboard: Remove Show/Hide calls
And merge with the "internal" show/hide() ones. Those functions don't
proxy dbus method calls anymore, so it makes no sense to expose these.
Also, the timestamp is no longer needed as there is a single source for
these events.
Carlos Garnacho [Mon, 16 Jan 2017 15:21:01 +0000 (16:21 +0100)]
keyboard: Avoid runtime dependency on the Caribou daemon
The caribou daemon only gives us focus tracking, which is almost 1:1 with
our own FocusCaretTracker implementation. This means we can entirely
replace the Caribou daemon inside gnome-shell, reducing the Caribou
dependency to just libcaribou, and more specifically the
CaribouKeyboardModel we pull the keyboard models from.
As we still need underneath a CaribouDisplayAdapter to drive the keyboard,
reuse the wayland one, which has been renamed to make it look generic, plus
it will use the virtual input device API from mutter/clutter.
Daiki Ueno [Wed, 3 May 2017 08:28:31 +0000 (10:28 +0200)]
search: copy result to clipboard if requested
Some search providers such as GNOME Characters want to copy search
results to clipboard. However, on Wayland, clipboards are only
accessible from applications that have a visible surface on display.
This patch allows a search provider to request the shell to copy a
search result to clipboard when 'clipboardText' is included in the meta
of the result.
popupMenu: Change the position of the icon in PopupImageMenuItem
We are moving the icon to be added before the text instead of after,
which is consistent with other menu items in other popup menus, such
as the ones in the system indicator's popup menu.
popupMenu: Allow specifying an icon on PopupMenuBase.addAction()
This allows passing an optional icon parameter to addAction()
so that a PopupImageMenuItem instance is created instead of a
PopupMenuItem if an icon is specified.
popupMenu: Accept either an icon name or a GIcon on PopupImageMenuItem
Add an extra check to setIcon() so that either a GIcon or an string
with the icon's name is handlded, so that we can create menu items
in different ways (e.g. by passing a GIcon created from a resource).
Florian Müllner [Mon, 1 May 2017 10:49:55 +0000 (12:49 +0200)]
theme: Use font-relative width for prompts
The usual expectation when selecting large fonts is for content to
be bigger, not that less content is displayed. While not always
possible, there's no reason not to scale modal dialogues with the
font size.
Florian Müllner [Thu, 4 May 2017 22:27:32 +0000 (00:27 +0200)]
entry: Fix *-icon-clicked handler
Commit ffe4eaf00d8 broke the handler by fetching the instance private
from the wrong actor - as we don't use the ::primary-icon-clicked signal,
and the ::secondary-icon-clicked signal still works by accident, nobody
noticed until now ...